<?php use_stylesheet('list.css')?>

<table id="lista">
<thead>
    <tr>
      <th>Plant</th>
      <th>Device</th>
      <th>Update</th>
      <th>Status</th>
      <th>Latency</th>
    </tr>
  </thead>
  
  <tbody>
    <?php  
    if (count($checks)>0){
            foreach ($checks as $key=>$check){
            $odd = fmod($key, 2) ? 'odd' : 'even';?>
          <tr class="<?php echo $odd ?>">
            <td> <?php echo $check["netdev"]->getPlant()->getName() ?></td>
            <td><a href="<?php echo url_for('netmonitor_show_dev',$check["netdev"]) ?>"> <?php echo $check["netdev"] ?></a></td>
      <?php  
                $result=($check["result"]==1)?"Connected":"No Link";
                $light=($check["result"]==1)?"greenlight":"redlight";?>
                <td> <?php echo $check["checktime"] ?></td>
                <td class="<?php echo $light ?>"> <?php echo $result ?></td>
                <td> <?php echo $check["latency"]."  ms" ?></td>
      <?php 
             }
        }?>     
  </tbody>
</table>